package com.ordersystem.service.impl;

import com.ordersystem.domain.Role;
import com.ordersystem.mappers.RoleMapper;
import com.ordersystem.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author : asus1020
 * @version : [v1.0]
 * @className : RoleServiceImpl
 * @description : [描述说明该类的功能]
 * @createTime : [2022/3/25 17:04]
 * @updateUser : asus1020
 * @updateTime : [2022/3/25 17:04]
 * @updateRemark : [描述说明本次修改内容]
 */
@Service
public class RoleServiceImpl implements RoleService {
    @Autowired
    private RoleMapper roleMapper;

    @Override//查询所有角色列表
    public List<Role> findRoleList() {
        return roleMapper.findRoleList();
    }

    @Override//根据id查询单个角色
    public Role findRoleById(Integer rid) {
        return roleMapper.findRoleByRid(rid);
    }

    @Override//修改角色
    public int updateRole(Role role) {
        return roleMapper.updateRole(role);
    }

    @Override//删除单个角色
    public int deleteRole(Integer rid) {
        return roleMapper.deleteRole(rid);
    }

    @Override//添加角色
    public int addRole(Role role) {
        return roleMapper.addRole(role);
    }
}
